<?php require_once("oj-header.php");
	require_once("./include/db_info.inc.php");
	echo "<title>Welcome To OpenOJ ACM-ICPC Online Judge</title>";
	$sql=	"SELECT * "
			."FROM `news` "
			."WHERE `defunct`!='Y'"
			."ORDER BY `importance` ASC,`time` DESC "
			."LIMIT 5";
	$result=mysql_query($sql);//mysql_escape_string($sql));
	if (!$result){
		echo "<h3>No News Now!</h3>";
		echo mysql_error();
	}else{
		echo "<table width=\"100%\"><tr><td><center>";
		echo "<table>";
		
		while ($row=mysql_fetch_object($result)){
			echo "<tr><td align='left'><big><b>".$row->title."</b></big>-<small>[".$row->user_id."]</small></td></tr>";
			echo "<tr><td align='left'>".$row->content."</td></tr>";
		}
		mysql_free_result($result);
		echo "<tr><td><br /><big><b>Update Log:</b></big></td></tr>";
		echo "<tr><td>";
		echo "2011-11-21: Support Virtual Judge<br />";
		echo "2011-09-23: Add IP Check to Contest<br />";
		echo "2011-08-19: Fixed Some discuss's bugs<br />";
		echo "2011-08-08: Fixed Some Contest's bugs<br />";
		echo "2011-08-07: Enable Checking the same code<br />";
		echo "2011-07-26: Add Some Functions<br />";
		echo "2011-07-20: Update HUSTOJ svn 1142<br />";
		echo "</td></tr>";
		if(function_exists('apc_cache_info')):
		$_apc_cache_info = apc_cache_info();?>
<tr><td><br /><big><b>Alternative PHP Cache:</b></big><strong>ACTIVE</strong></td></tr>
<tr><td><strong>Performace Data<strong></td></tr>
<tr><td><ul id="apc">
	<li><span>Hits: </span><?php echo $_apc_cache_info['num_hits']?></li>
	<li><span>Misses: </span><?php echo $_apc_cache_info['num_misses']?></li>
	<li><span>Entries: </span><?php echo $_apc_cache_info['num_entries']?></li>
	<li><span>Inserts: </span><?php echo $_apc_cache_info['num_inserts']?></li>
	<li><span>Cached Files: </span><?php echo $_apc_cache_info['mem_size']/1024?>KB</li>
</ul></td></tr>
<?php endif;?>
<?php
		echo "</table></center></td></tr></table>";
	}
?>
<?php require('oj-footer.php');?>
